#include "mesh/GeneratedMesh.h"

#include <gtest/gtest.h>
#include <iostream>
#include <petsc.h>
#include <vector>
using std::vector;
TEST(Paramter, equal){

    Parameter params;
    params.add("dims");
    params.set<Id3>("dims", { 1,1,1 });
    std::cout << params.get<Id3>("dims") << std::endl;
    params.add<int>("b", 123);
    params.set<int>("b", 1);
    EXPECT_EQ(params.get<int>("b"), 1);

    params.add<vector<int>>("vector", { 1,2,3 });
    auto value = params.get<vector<int>>("vector");
    EXPECT_EQ(value[0], 1);
    EXPECT_EQ(value[1], 2);
    EXPECT_EQ(value[2], 3);
    EXPECT_EQ(value.size(), 3);

    enum class Color
    {
        RED,
        GREEN,
        BLUE
    };

    params.add<Color>("color", Color::RED);
    auto color = params.get<Color>("color");
    EXPECT_EQ(color, Color::RED);
    params.set<Color>("color", Color::GREEN);
    color = params.get<Color>("color");
    EXPECT_EQ(color, Color::GREEN);
}

TEST(libmesh, paramters)
{
    libMesh::Parameters p;
    p.set<int>("a") = 1;
    p.set<string>("ab") = "aba";
    p.set<vector<int>>("c") = { 12,1 };

    enum Color
    {
        RED,
        GREEN,
        BLUE
    };
    
    p.set<Color>("color") = RED;
    EXPECT_EQ( p.get<int>("a"), 1);
    p.print();
}